package com.lxp.queue;


/**
 * @Author swd
 * @Create 2020/8/7 0007 16:44
 */
public class TestResult {
    public static void main(String[] args) {
        OrderQueue<String> orderQueue = new OrderQueue<>(5);
        System.out.println("初始化：" + orderQueue.toString());
        System.out.println("队列是否为空：" + orderQueue.isNull());
        orderQueue.offer("a");
        orderQueue.offer("b");
        orderQueue.offer("c");
        orderQueue.offer("d");
        orderQueue.offer("e");//循环队列会减少1个空间，此数据插入不了
        System.out.println("插入数据：" + orderQueue.toString());
        //OrderQueue{datas=[a, b, c, d, null], maxSize=5, front=0, rear=4}

        System.out.println("队列是否已满：" + orderQueue.isFull());
        System.out.println(orderQueue.poll());
        System.out.println("删除1个数据：" + orderQueue.toString());
        System.out.println(orderQueue.poll());
        System.out.println("删除2个数据：" + orderQueue.toString());
        System.out.println(orderQueue.poll());
        System.out.println("删除3个数据：" + orderQueue.toString());
        System.out.println(orderQueue.poll());
        System.out.println("删除4个数据：" + orderQueue.toString());
        System.out.println(orderQueue.poll());
        System.out.println("删除5个数据：" + orderQueue.toString());
    }
}
